
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="/resource/UserPwoer.tld" prefix="p"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	pageContext.setAttribute("fnId", request.getAttribute("fnId"));
	pageContext.setAttribute("userPwoer", request.getSession().getAttribute("userPwoer"));
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/echarts.js"></script>
</head>
<body class="gray-bg">
	<nav class="huiNav">
		<%@include file="project-nav.jsp"%> 项目信息 <a
			class="btn btn-info  btn-sm pull-right"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="fa fa-refresh"></i></a>
	</nav>


	<input type="hidden" value="${param.id}" id="projectId">
	<div class="ibox-content">

		<div class="row">
			<div class="col-md-12 ">
				<div class="panel panel-default">
					<div class="panel-heading">项目概况</div>
					<div class="panel-body">
						<c:if
							test="${user.role.name eq '项目经理' or user.role.name eq '总经理'}">
							<div class="btn-group">
								<div class="btn-group">
									<label style="margin-right: 10px; padding-top: 9px">项目阶段:</label>
								</div>
								<div class="btn-group" style="margin-right: 10px">
									<select name="status" id="status"
										class=" select2 form-control autoFull"
										style="width: 350px; color: #333" data-filed="name"
										data-value="name" data-def="${obj.status}"
										data-url="${path}/admin/dataDictionary/showDataDictionary"
										data-param="{type:'项目状态'}">
										<option value="">请选择项目阶段</option>
									</select>
								</div>
								<button type="button" class="btn btn-default"
									onclick="updateStatus()">修改</button>
							</div>
						</c:if>
						<c:if
							test="${user.role.name ne '项目经理' and user.role.name ne '总经理'}">
							<h3 class="panel-title">项目状态 ：${obj.status}</h3>
						</c:if>
					</div>
				</div>
			</div>
		</div>
		<input type="hidden" id="createTime" value="${obj.createTime}">
		<input type="hidden" id="endTime" value="${obj.endTime}">
		<div class="row">
			<div class="col-md-12 ">
				<div class="panel panel-default">
					<div class="panel-heading">项目质量情况</div>
					<div class="panel-body">

						<div class="row">
							<div id="echarts3" style="height: 350px" class="col-xs-12"></div>
							<div class="col-xs-1"></div>
						</div>
						<div class="row">
							<div id="echarts4" style="height: 350px" class="col-xs-12"></div>
							<div class="col-xs-1"></div>
						</div>
						<div class="row">
							<div id="echarts5" style="height: 350px" class="col-md-10"></div>
							<div class="col-md-1"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-6 ">
				<div class="panel panel-default">
					<div class="panel-heading">项目概况</div>
					<div class="panel-body">
						<table style="width: 100%">
							<tr>
								<th align="right">项目名称：</th>
								<td>&nbsp;${obj.projName}</td>
							</tr>
							<tr>
								<th align="right">客户信息：</th>
								<td>&nbsp;${obj.client.companyName}</td>
							</tr>
							<tr>
								<th align="right">对&nbsp;接&nbsp;人&nbsp;：</th>
								<td>&nbsp;${obj.client.contactName}</td>
							</tr>
							<tr>
								<th align="right">联系方式：</th>
								<td>&nbsp;${obj.client.companyTel}</td>
							</tr>
							<tr>
								<th align="right">立项时间：</th>
								<td>&nbsp;<fmt:formatDate value="${obj.createTime}"
										type="date" /></td>
							</tr>
							<tr>
								<th align="right">项目介绍：</th>
								<td>&nbsp;${obj.introduction}</td>
							</tr>

							<tr>
								<th align="right">项目访问地址：</th>
								<td>&nbsp;${obj.url}</td>
							</tr>
							<tr>
								<th align="right">项目源码地址：</th>
								<td>&nbsp;${obj.gitUrl}</td>
							</tr>
						</table>
					</div>
				</div>
			</div>
			<div class="col-md-6">
				<div class="panel panel-default">
					<div class="panel-heading">研发投入</div>
					<div class="panel-body">
						<table style="width: 100%">
							<c:choose>
								<c:when test="${!empty projectUserList}">
									<c:forEach items="${projectUserList}" var="item">
										<tr>
											<th style="width: 20%;" align="right">${item.postName}:</th>
											<td>&nbsp;${item.userName}</td>

											<td><c:if test="${item.beginTime ne null}">
													<fmt:formatDate value="${item.beginTime}" type="date" /> 至
										<c:choose>
														<c:when test="${item.endTime ne null}">
															<fmt:formatDate value="${item.endTime}" type="date" />
														</c:when>
														<c:otherwise>
												&nbsp;&nbsp; --
											</c:otherwise>
													</c:choose>
												</c:if>&nbsp;</td>
										</tr>
									</c:forEach>
								</c:when>
								<c:otherwise>
						暂无数据
					</c:otherwise>
							</c:choose>

						</table>
					</div>
				</div>
			</div>

		</div>

		<div class="row">
			<div class="col-md-12 ">
				<div class="panel panel-default">
					<div class="panel-heading">研发进度信息</div>
					<div class="panel-body">
						<div class="progress">
							<div class="progress-bar" id="time" role="progressbar"
								aria-valuenow="${proportion}" aria-valuemin="0"
								aria-valuemax="100" style="width: ${proportion}%;">${proportion}%</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="row">
			<div class="col-md-12 ">
				<div class="panel panel-default">
					<div class="panel-heading">总体任务情况</div>
					<div class="panel-body">
						<div class="row  text-center">
							总任务：<strong id="taskTotal">&nbsp;</strong>个
						</div>
						<br>

						<div class="col-xs-5">
							<div id="echarts1" style="height: 350px"></div>
						</div>
						<div class="col-xs-5">
							<div id="echarts2" style="height: 350px"></div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="row">
			<div class="col-md-12 ">
				<div class="panel panel-default">
					<div class="panel-heading">任务细分表</div>
					<div class="panel-body">
						<div id="echarts6" style="height: 350px" class="col-xs-12"></div>
						<div class="col-xs-1"></div>
				</div>
				<div class="row">
						<div id="echarts7" style="height: 350px" class="col-xs-12"></div>
						<div class="col-xs-1"></div>
				</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12 ">
				<div class="panel panel-default">
					<div class="panel-heading">成本分析图</div>
					<div class="panel-body">
						<div id="echarts8" style="height: 350px" class="col-xs-12"></div>
						<div class="col-xs-1"></div>
				</div>
				<div class="row">
						<div id="echarts9" style="height: 350px" class="col-xs-12"></div>
						<div class="col-xs-1"></div>
				</div>
				</div>
			</div>
		</div>
	</div>


</body>
<script type="text/javascript">
	//开始项目
	function updateStatus() {
		if ($("#status").val() != null && $("#status").val() != "") {
			$.AjaxProxy({
				a : false,
				c : true,
				p : {
					id : $("#projectId").val(),
					status : $("#status").val()
				}
			}).invoke(
					"${path}/admin/projectInfo/updateStatus",
					function(loj) {
						layer.msg('项目状态修改成功', {
							icon : 1
						}, function(index) {
							MTools.redirect("${path}/admin/projectInfo/all?id="
									+ $("#projectId").val());
						})
					})
		} else {
			layer.msg("请选择项目状态", {
				icon : 2
			})
		}
	}
	/*	//交付完成
	function endProj(){
		$.AjaxProxy({a : false,c:true,p:{id:$("#projectId").val()}}).invoke("${path}/admin/projectInfo/projEnd",function(loj){
			MTools.redirect("${path}/admin/projectInfo/all?id="+$("#projectId").val());
		})
	}
	//打开编辑界面
	function editor() {
		layer.open({
			type : 2,
			title : "编辑项目信息",
			area : [ MUI.SIZE_L, '400px' ],
			maxmin : true,
			content : [ '${path}/admin/projectInfo/openEditor?id='+$("#projectId").val()]
		});
	} */

	$(function() {
		MTools.autoFullSelect();
		//更新数据库
		$.AjaxProxy({
			a : true,
			c : false
		}).invoke("${path}/admin/projectInfo/qTask", function(loj) {
		});
		//加载所有的研发人员
		var userIdList = []; //用户Id
		var name = []; //用户名
		var score = []; //代码平均分
		$.AjaxProxy({
			a : false,
			c : false,
			p : {
				projId : $("#projectId").val()
			}
		}).invoke("${path}/admin/projectInfo/queryPostName", function(loj) {
			for (var i = 0; i < loj.getRowCount(); i++) {
				name[i] = loj.getString(i, "userName");
				userIdList[i] = loj.getString(i, "userId");
				score[i] = loj.getString(i, "scoreAvg");
			}
		})
		//任务进度
		$
				.AjaxProxy({
					a : true,
					c : false,
					p : {
						projId : $("#projectId").val()
					}
				})
				.invoke(
						"${path}/admin/projectInfo/queryTask",
						function(loj) {
							var yTask = 0, nTask = 0, cTask = 0, yksTask = 0, wksTask = 0, zTask = 0, yqxTask = 0;
							for (var i = 0; i < loj.getRowCount(); i++) {
								if (loj.getString(i, "status") != '已取消') { //取消的任务不进行计算
									if (loj.getString(i, "status") == '已完成') {
										yTask++; //已完成数量
									} else {
										if (loj.getString(i, "status") == "未开始") {
											wksTask++; //未开始
										} else if (loj.getString(i, "status") == "已开始") {
											yksTask++; //已开始
										}
										nTask++;//未完成数量
									}

									if (loj.getString(i, "overtime") > 0) {
										cTask++; //超时数据
									}
									zTask++;//总任务
								} else {
									yqxTask++;//已取消任务
								}
							}
							$("#taskTotal").empty().html(zTask);

							var wTask = Number(zTask) - Number(cTask);//未超时数量
							var myEcharts1 = echarts.init(document
									.getElementById("echarts1"));
							myEcharts1.setOption({
								title : {
									text : '任务完成比率',
								},
								tooltip : {
									trigger : 'item',
									formatter : "{a} <br/>{b}: {c} ({d}%)"
								},
								legend : {
									orient : 'vertical',
									x : 'left',
									y : 'bottom',
									data : [ '已完成', '未完成' ]
								},
								series : [ {
									name : '任务完成比率',
									type : 'pie',
									radius : [ '50%', '70%' ], //内环半径，外环半径
									avoidLabelOverlap : false,
									itemStyle : {
										normal : {
											label : {
												show : true,
												formatter : '{d}%'
											},
											labelLine : {
												show : true
											}
										}
									},
									data : [ {
										value : yTask,
										name : '已完成'
									}, {
										value : nTask,
										name : '未完成'
									} ]
								} ]
							})

							//alert(new Date() < new Date($("#endTime").val()) )
							/* if(new Date() < new Date($("#endTime").val())){
								nTask = loj.getRowCount();
								yTask = 0;
							}  */

							var myEcharts2 = echarts.init(document
									.getElementById("echarts2"));
							myEcharts2.setOption({
								title : {
									text : '任务延期比率',
								},
								tooltip : {
									trigger : 'item',
									formatter : "{a} <br/>{b}: {c} ({d}%)"
								},
								legend : {
									orient : 'vertical',
									x : 'left',
									y : 'bottom',
									data : [ '延期率', '未延期率' ]
								},
								series : [ {
									name : '任务延期比率',
									type : 'pie',
									radius : [ '50%', '70%' ], //内环半径，外环半径
									avoidLabelOverlap : false,
									itemStyle : {
										normal : {
											label : {
												show : true,
												formatter : '{d}%'
											},
											labelLine : {
												show : true
											}
										}
									},
									data : [ {
										value : cTask,
										name : '延期率'
									}, {
										value : wTask,
										name : '未延期率'
									} ]
								} ]
							})
							var myEcharts6 = echarts.init(document
									.getElementById("echarts6"));
							myEcharts6
									.setOption({
										title : {
											subtext : "(任务总数=未开始+已开始+已完成    注意：已取消的任务不计总数)",
											subtextStyle : {
												color : '#C1232B',
											},
										},
										tooltip : {
											trigger : 'axis',
											axisPointer : { // 坐标轴指示器，坐标轴触发有效
												type : 'shadow' // 默认为直线，可选为：'line' | 'shadow'
											}
										},

										xAxis : [ {
											type : 'category',
											data : [ '未开始', '已开始', '已完成', '已取消' ],
											axisTick : {
												alignWithLabel : true
											}
										} ],
										yAxis : [ {
											type : 'value',
										} ],
										series : [ {
											name : '任务数量',
											type : 'bar',
											barWidth : '60%',
											itemStyle : {
												normal : {
													color : function(params) {
														// build a color map as your need.
														var colorList = [
																'#C1232B',
																'#C1232B',
																'#C1232B',
																'#F3A43B' ];
														return colorList[params.dataIndex]
													},
												}
											},
											data : [ wksTask, yksTask, yTask,
													yqxTask ]
										} ]

									})
							//个人任务清单
							var taskZ = [], taskY = [], taskC = [];
							for (var a = 0; a < userIdList.length; a++) {
								var taskTotal = 0, taskYwc = 0, taskCs = 0;
								for (var b = 0; b < loj.getRowCount(); b++) {
									if (loj.getString(b, "status") != "已取消") {
										if (userIdList[a] == loj.getString(b,
												"userId")) {
											taskTotal++; //个人总数
											if (loj.getString(b, "status") == "已完成") {
												taskYwc++; //个人已完成
											}
											if (Number(loj.getString(b,
													"overtime")) > 0) {
												taskCs++; //个人超时
											}
										}
									}
								}
								taskZ[a] = taskTotal;
								taskY[a] = taskYwc;
								taskC[a] = taskCs;
							}

							var myEcharts7 = echarts.init(document
									.getElementById("echarts7"));
							myEcharts7.setOption({
								//表头
								title : {},
								//提示框		
								tooltip : {
									trigger : 'axis',
									axisPointer : { // 坐标轴指示器，坐标轴触发有效
										type : 'shadow' // 默认为直线，可选为：'line' | 'shadow'
									},
								},
								//内容
								legend : {
									data : [ '总数', '已完成', '超时' ]
								},
								//x轴坐标
								xAxis : {
									type : 'category',
									data : name
								},
								//y轴坐标
								yAxis : {
									type : 'value'
								},
								//
								series : [ {
									name : "总数",
									type : "bar",
									stack : '数量', //名称相同就可堆叠为一组
									data : taskZ,
								}, {
									name : "已完成",
									type : "bar",
									data : taskY,
								}, {
									name : "超时",
									type : "bar",
									data : taskC,
								} ]
							})
						})

		/* for(var j=0;j<userIdList.length;j++){
			$.AjaxProxy({a : false,c : false,p:{ownerUserId:userIdList[j],projId:$("#projectId").val()}}).invoke("${path}/admin/projectInfo/queryBug",function(loj){
				totalData[j]=loj.getRowCount();//总bug
				var a=0;
				for(var k = 0; k < loj.getRowCount(); k++){
					if(loj.getString(k,"status") == '关闭'){
						a++;
					}
				}
				
				
				
				data[j]=Number(loj.getRowCount())-Number(a); //未解决bug
			})
		} */

		//总bug 统计
		//bug数量
		$
				.AjaxProxy({
					a : false,
					c : false,
					p : {
						projId : $("#projectId").val()
					}
				})
				.invoke(
						"${path}/admin/projectInfo/queryBug",
						function(loj) {
							var bugTotal = 0, yBug = 0, nBug = 0, yqBug = 0, cfBug = 0, wfBug = 0, byBug = 0, wbBug = 0, sgBug = 0, gbBug = 0;
							bugTotal = loj.getRowCount();
							for (var i = 0; i < loj.getRowCount(); i++) {
								if (loj.getString(i, "type") == '已解决') {
									yBug++;
								} else if (loj.getString(i, "type") == '待解决') {
									nBug++;
								} else if (loj.getString(i, "type") == '延期处理') {
									yqBug++;
								} else if (loj.getString(i, "type") == '重复bug') {
									cfBug++;
								} else if (loj.getString(i, "type") == '无法重现') {
									wfBug++;
								} else if (loj.getString(i, "type") == '不予解决') {
									byBug++;
								} else if (loj.getString(i, "type") == '外部原因') {
									wbBug++;
								} else if (loj.getString(i, "type") == '设计如此') {
									sgBug++;
								}
								if (loj.getString(i, "status") == '关闭') {
									gbBug++;
								}
							}

							var myEcharts3 = echarts.init(document
									.getElementById("echarts3"));
							myEcharts3
									.setOption({
										//表头
										title : {
											text : "bug统计 :总数 " + bugTotal,
											subtext : "(bug总数=已解决+未解决+延期处理+重复bug+无法重现+不予解决+外部原因+设计如此)",
											subtextStyle : {
												color : '#C1232B',
											},
										//backgroundColor : '#F3A43B',
										},
										//提示框		
										tooltip : {
											trigger : 'axis',
											axisPointer : { // 坐标轴指示器，坐标轴触发有效
												type : 'shadow' // 默认为直线，可选为：'line' | 'shadow'
											},
										},
										//内容
										legend : {
											data : [ 'bug数量' ]
										},
										//x轴坐标
										xAxis : {
											type : 'category',
											data : [ '已解决', '未解决', '延期处理',
													'重复bug', '无法重现', '不予解决',
													'外部原因', '设计如此', '关闭' ]
										},
										//y轴坐标
										yAxis : {
											type : 'value'
										},
										//
										series : [ {
											name : 'bug数量',
											type : 'bar',
											itemStyle : {
												normal : {
													color : function(params) {
														// build a color map as your need.
														var colorList = [
																'#C1232B',
																'#C1232B',
																'#C1232B',
																'#C1232B',
																'#C1232B',
																'#C1232B',
																'#C1232B',
																'#C1232B',
																'#F3A43B', ];
														return colorList[params.dataIndex]
													},
												/*  label: {
												     show: true,
												     position: 'top',
												     formatter: '{b}\n{c}'
												 } */
												}
											},
											data : [ yBug, nBug, yqBug, cfBug,
													wfBug, byBug, wbBug, sgBug,
													gbBug ]
										} ]

									})

							//个人bug统计
							var totalData = [], data = [];
							for (var a = 0; a < userIdList.length; a++) {
								var bugZs = 0, bugYgb = 0
								for (var b = 0; b < loj.getRowCount(); b++) {
									if (userIdList[a] == loj.getString(b,
											"ownerUserId")) {
										bugZs++; //个人bug总数
										if (loj.getString(b, "status") == '关闭') {
											bugYgb++;
										}
									}
								}
								var bugWgb = bugZs - bugYgb;
								totalData[a] = bugZs;
								data[a] = bugWgb;
							}

							var myEcharts4 = echarts.init(document
									.getElementById("echarts4"));
							myEcharts4.setOption({
								title : {
									text : "个人bug清单",
									subtext : "(已解决bug != 关闭bug)",
									subtextStyle : {
										color : '#C1232B',
									},
								},
								tooltip : {
									trigger : 'axis',
									axisPointer : { // 坐标轴指示器，坐标轴触发有效
										type : 'shadow' // 默认为直线，可选为：'line' | 'shadow'
									}

								},
								legend : {
									data : [ '总bug', '未关闭bug' ]
								},
								xAxis : [ {
									data : name
								} ],
								yAxis : [ {} ],
								series : [ {
									name : "总bug",
									type : "bar",
									stack : '数量', //名称相同就可堆叠为一组
									data : totalData,
								}, {
									name : "未关闭bug",
									type : "bar",
									data : data,
								} ]
							})
						})

		//代码平均分

		var myEcharts5 = echarts.init(document.getElementById("echarts5"));
		myEcharts5.setOption({
			//表头
			title : {
				text : "代码评分"
			},
			//提示框		
			tooltip : {
				trigger : 'axis',
				axisPointer : { // 坐标轴指示器，坐标轴触发有效
					type : 'shadow' // 默认为直线，可选为：'line' | 'shadow'
				},
			},
			//内容
			legend : {
				data : [ '评审平均分' ]
			},
			//x轴坐标
			xAxis : {
				type : 'category',
				data : name
			},
			//y轴坐标
			yAxis : {
				type : 'value',
				min : 0,
				max : 100
			},
			//
			series : [ {
				name : '评审得分',
				type : 'bar',
				data : score
			} ]

		})
		
	})
	
	$.AjaxProxy({
					a : false,
					c : false,
					p : {
						projId : $("#projectId").val()
					}
				})
				.invoke(
						"${path}/admin/WorkLogAction/summaryGraph",
						function(loj) {
							//获取到放回Map对象
							var obj=loj[0].result.mapInfo;
							//横坐标
							var xData=[];
							//纵坐标
							var yData={};
							
							//总成本纵坐标
							var yDatatotal={};
							//索引
							var i =1;
							//拿到Map对象长度
							var len = (Object.keys(obj)).length;
							//创建一个数组
							var arr = [];
							//总数
							var number =0;
							//索引
							var f =0;
							//遍历Map集合对象
							for(var i in obj){
								//拿到List数组长度
								arr.push(obj[i].length)
								//拿到一个对象
								var item = obj[i];
									//创建y轴数据
									yData[f] =[];
									yDatatotal[f]=[];
									//拿到y轴数组对象
									for(var k=0;k<item.length;k++){
										//添加到数组中
										yData[f].push(item[k].price)
									}
									for(var n=0;n<item.length;n++){
										number = number + item[n].price
										//添加到数组中
										yDatatotal[f].push(number)
									}
								//索引自增
								f++;
							}
							//创建横坐标的最大长度
							var xMaxLen = max(arr);
							//变量obj
							for(var i in obj){
								//拿到obj中长度最大的对象
								if(obj[i].length==xMaxLen){
									//对的对象
									var item = obj[i];
									//遍历对象
									for(var j=0;j<item.length;j++){
										//拿到X轴数组对象
										xData.push(MTools.farmterTime(item[j].createTime))
									}
									break;
								}
								
							}
							//判断数组大小
							 function max(arr){
							        var j = arr[0]
							        for (var i=1;i<arr.length ;i++ ){
							            if(arr[i]>j){
							                j = arr[i];
							            }
							        }
							        return j;
							     }
							
							var series =[];
							var name =[];
							var num = 0;
							var totalPrice =0;
							var totalPrice = [];
							var seriestotal = [];
							//拿到对象数组
							for(var ob in obj){
								//创建json对象
								var json={type:'line',stack: '总量'};
								var jsontotal={type:'line',stack: '总量'};
								console.log(ob);
								//拿到obj子对象
								var item =obj[ob]
								//为json添加属性
								json.name=item[0].projName;
								jsontotal.name=item[0].projName;
								
								//为json添加属性
								json.data=yData[num];
								jsontotal.data=yDatatotal[num];
								//添加对象
								name.push(item[0].projName);
								totalPrice.push(item[0].totalPrice);
								//添加json数组
								series.push(json);
								seriestotal.push(jsontotal);
								
								totalPrice=item[0].totalPrice;
								num++;
							}
							
							// 基于准备好的dom，初始化echarts实例
							  var myEcharts8 = echarts.init(document.getElementById('echarts8'));
							  // 指定图表的配置项和数据
							  myEcharts8.setOption ({
							  		title: {
							  	        text: '项目每日成本统计'
							  	    },
								  	tooltip: {
								          trigger: 'axis'
								    },
							  	    legend: {
							  	        data:name
							  	    },
								  	grid: {
							          left: '3%',
							          right: '4%',
							          bottom: '3%',
							          containLabel: true
								    },
							  	    xAxis:{
							  	        type: 'category',
							  	     	boundaryGap: false,
							  	        data: xData
							  	    },
							  	    yAxis:{
							  	        type: 'value'
							  	    },
							  	    series: series
							  	});
							
						
	
	  				var myEcharts9 = echarts.init(document.getElementById('echarts9'));
	 				console.log(name);
	 				console.log(totalPrice);
	 				 myEcharts9.setOption ({
					  		title: {
					  	        text: '项目开发成本统计图'
					  	    },
						  	tooltip: {
						          trigger: 'axis'
						    },
					  	    legend: {
					  	        data:name
					  	    },
						  	grid: {
					          left: '3%',
					          right: '4%',
					          bottom: '3%',
					          containLabel: true
						    },
					  	    xAxis:{
					  	        type: 'category',
					  	     	boundaryGap: false,
					  	        data: xData
					  	    },
					  	    yAxis:{
					  	        type: 'value'
					  	    },
					  	    series: seriestotal
					  	});
						});
</script>
</html>
